package com.zzw.zim.system.controller;


import com.zzw.zim.common.utils.Result;
import com.zzw.zim.system.dto.AddRoleMenuDTO;
import com.zzw.zim.system.service.SysRoleMenuService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;


/**
 * 角色菜单关系
 *
 * @author XiaoJie
 * @date 2025-09-03 09:43:18
 */
@Tag(name = "系统角色菜单控制器")
@RestController
@RequestMapping("system/roleMenu")
public class RoleMenuController {

    @Resource
    private SysRoleMenuService roleMenuService;

    @PostMapping("add")
    @Operation(summary = "新增角色菜单")
    public Result<String> addRoleMenu (@RequestBody AddRoleMenuDTO dto) {
        return Result.ok(roleMenuService.addRoleMenu(dto));
    }

    @PostMapping("edit")
    @Operation(summary = "编辑角色菜单")
    public Result<String> editRoleMenu (@RequestBody AddRoleMenuDTO dto) {
        return Result.ok(roleMenuService.editRoleMenu(dto));
    }

    @PostMapping("remove/{roleId}")
    @Operation(summary = "删除角色菜单")
    public Result<String> removeRoleMenu (@PathVariable("roleId") String roleId) {
        return Result.ok(roleMenuService.removeByRoleId(roleId));
    }

//    @PostMapping("queryPage")
//    @Operation(summary = "查询角色菜单")
//    public Result<String> queryPageRoleMenu (@RequestBody AddRoleMenuDTO dto) {
//        return Result.ok(roleMenuService.queryPageRoleMenu(dto));
//    }
}
